package com.anlu.pattern.create.factory.simple;

import com.anlu.pattern.common.entity.Fruit;

/**
 * @author anlu
 * @create 2019/11/21
 **/

public class StaticFactoryClient {

    public static void main(String[] args){
        jamesdo();

    }

    //Peter自己吃水果
    public static void peterdo(){
        Fruit fruit = StaticFactory.getFruit(StaticFactory.TYPE_APPLE);
        fruit.draw();
        //吃完了
        System.out.println("-----------");
    }

    /**
     * james老师吃水果
     */
    public static void jamesdo(){
        Fruit fruit =  StaticFactory.getFruit(StaticFactory.TYPE_BANANA);
        fruit.draw();
        //切开吃
        System.out.println("-----------");
    }

    //送给lison榨汁喝
    public static void lisondo(){
        Fruit fruit = StaticFactory.getFruit(StaticFactory.TYPE_APPLE);
        fruit.draw();
        //。。。榨汁动作
        System.out.println("-----------------");
    }
}
